package com.example.springboottest.example.thread.forkjoin;

import com.example.springboottest.example.thread.TestSyncService;

public class JoinThreadTest implements Runnable {
    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            System.out.println(Thread.currentThread().getName() + "\t" + i);
        }
    }

    public static void main(String[] args) throws InterruptedException {
        JoinThreadTest joinThread = new JoinThreadTest();
        Thread t1 = new Thread(joinThread);
        t1.start();
        t1.join();
        System.out.println(Thread.currentThread().getName() + "\t等待joinThread执行完才能结束");
    }
}
